* stata version 15

* NOW FOR STUDY 3: 2018 DATA

use "/Users/davidbarker/Google Drive/Research/Facts and Premises/premis mturk BJPOLS dataverse mturk 2018 7 2020.dta"

*MAKING THE OUTCOME VARIABLE

alpha humansselfish humansdevious humansundiscip humansfail
factor humansselfish humansdevious humansundiscip humansfail, ml
predict humansbadfactor01
sum humansbadfactor01
replace humansbadfactor01 = humansbadfactor01 + 1.090166
sum humansbadfactor01
replace humansbadfactor01 = humansbadfactor01 / 2.307646
sum humansbadfactor01

*generating the interaction terms
gen humansgoodpromptXlibcon301 = libcon301 * humansgoodprompt
gen humansbadpromptXlibcon301 = libcon301 * humansbadprompt

* running the main regression model and generating the predicted values for the figure

reg humansbadfactor01 libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 female white age01 incomecorrect01 educcorrect01 if interest3pt==2
sum humansbadfactor01
prvalue, x (libcon301=0 humansgoodprompt=0 humansbadprompt=0 humansgoodpromptXlibcon301=0 humansbadpromptXlibcon301=0)
prvalue, x (libcon301=0 humansgoodprompt=1 humansbadprompt=0 humansgoodpromptXlibcon301=0 humansbadpromptXlibcon301=0)
prvalue, x (libcon301=1 humansgoodprompt=0 humansbadprompt=1 humansgoodpromptXlibcon301=0 humansbadpromptXlibcon301=0)
prvalue, x (libcon301=1 humansgoodprompt=0 humansbadprompt=0 humansgoodpromptXlibcon301=0 humansbadpromptXlibcon301=0)
prvalue, x (libcon301=1 humansgoodprompt=1 humansbadprompt=0 humansgoodpromptXlibcon301=1 humansbadpromptXlibcon301=0)
prvalue, x (libcon301=1 humansgoodprompt=0 humansbadprompt=1 humansgoodpromptXlibcon301=0 humansbadpromptXlibcon301=1)

* now estimating without demographic covariates:
reg humansbadfactor01 libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 if interest3pt==2

* now just regressing the outcome variable on ideology, without the treatments
reg humansbadfactor01 libcon301  female white age01 incomecorrect01 educcorrect01 if interest3pt==2

* now the probit models (coefficients displayed as differences in predicted probabilities) for each outcome variable that is included in the factor score index:

tab1 humansselfish humansdevious humansundiscip humansfail

dprobit humansselfish libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 female white age01 incomecorrect01 educcorrect01 if interest3pt==2
dprobit humansdevious libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 female white age01 incomecorrect01 educcorrect01 if interest3pt==2
dprobit humansundiscip libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 female white age01 incomecorrect01 educcorrect01 if interest3pt==2
dprobit humansfail libcon301 humansgoodprompt humansgoodpromptXlibcon301 humansbadprompt humansbadpromptXlibcon301 female white age01 incomecorrect01 educcorrect01 if interest3pt==2
